<?php
namespace App\Admin\Validate\Base;


use App\Common\Validate\AbstractValidate;

class RoleValidate extends AbstractValidate
{
    protected function allRules(): array
    {
        return [
            "id|ID"       => 'require',
            "name|角色"     => 'require',
            "describe|描述" => 'require',
        ];
    }

    /**
     * @return RoleValidate
     */
    public function sceneUpdate(): RoleValidate
    {
        return $this->rule(["id", "name", "describe"]);
    }

    /**
     * @return RoleValidate
     */
    public function sceneStore(): RoleValidate
    {
        return $this->only(["name"]);
    }

    /**
     * @return RoleValidate
     */
    public function sceneDestroy(): RoleValidate
    {
        return $this->rule(['ids' => 'require'])->only(['ids']);
    }

    protected function allMessages(): array
    {
        return [];
    }
}
